<%-- 
    Document   : add_fav_acc_detail
    Created on : Sep 11, 2014, 10:56:33 AM
    Author     : hasnor
--%>

<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Akaun <i>Favourite Account<i/></title>
        <script type="text/javascript">
         $(document).ready(function(){
//                $('form').submit( function () {
//                    return formValidation();
//                }); 

            if(typeof String.prototype.trim !== 'function') {
                    String.prototype.trim = function() {
                      return this.replace(/^\s+|\s+$/g, ''); 
                    }
                  }
                  
            });
             function popupWin(){
                var url = '${pageContext.request.contextPath}/tac?generateAccFavAddTac';
                popupWindow = window.open(
                url,'popUpWindow',
                'height=450,width=630,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
            }
                        
           
            function validate(f)
            {
                if(document.getElementById("tac").value.trim().length<1)
                    {
                        alert("Sila Masukkan nombor TAC")
                        return false;
                    }
                else if(document.getElementById("tac").value.length<6)
                    {
                        alert("No TAC mesti mengandungi 6 aksara");
                        return false;
                    }
                else 
                    {
                        blockUI();
                        f.action="${pageContext.request.contextPath}/deposit?saveFavAcc";
                        f.submit();
                    }                    
            }
            
            function redirectToHomePage(f){
                var url = '${pageContext.request.contextPath}/deposit?showMainForm';
                f.action = url;
                f.submit();
            }   

            function goBack()
            {
                window.history.back();
            }
        </script>
    </head>
    <body>
        
        <s:form beanclass="th.stripes.action.DepositActionBean" class="niceform">
           <s:hidden name="deposit.noAkaunFav" id="noAkaunFav"></s:hidden> 
            <s:hidden name="deposit.namaAkaunFav" id="namaAkaunFav"></s:hidden>
            <s:hidden name="deposit.nicknameAkaunFav" id="nicknameAkaunFav"></s:hidden>
            
            <s:errors/>
            <s:messages/>
            <div id="content">
                <div id="logo">
                    <span>
                        <img src="${pageContext.request.contextPath}/images/img/ribbon.png"/>               
                    </span>
                </div>
                <h3>                
                  Tambah <i>Favourite Account</i>
                </h3>
               
                
                <p>
                    <label>No. Akaun TH :</label>
                    ${actionBean.deposit.noAkaunFav}&nbsp;
                </p>
                <p>
                    <label>Nama Pemegang </label><br/>
                    <label>Akaun TH :</label>
                    <label></label>${actionBean.deposit.namaAkaunFav}&nbsp;
                </p>
               
                 <p>
                     <label>Nama Samaran  </label><br/>
                     <label>(<i>Nickname</i>) Akaun :</label> 
                     <label></label>${actionBean.deposit.nicknameAkaunFav}&nbsp;
                </p>
               
                <p>
                    <label>Kod Pengesahan Transaksi :</label>
                    <s:password name="deposit.tacNumber" id="tac" class="required" size="6" maxlength="6"/>&nbsp;
                </p>
                <br>
                <p>
                    Transaksi ini memerlukan Kod Pengesahan Transaksi(TAC). 
                    Sila klik <a href="JavaScript:popupWin()">
                        Kod Pengesahan Transaksi(TAC)</a>untuk mendapatkan kod tersebut.
                </p>
                <br/>   
              
                 <p align="center"> 
                        <s:button name="back" value="Kembali" class="button green" onclick="goBack()"/>
                        <s:submit name="saveFavAcc" value="Simpan" class="button green button_blockUI"/> 
                        <s:submit name="showMainForm" value="Laman Utama" class="button green" onclick="redirectToHomePage(this.form)"/>
                </p>
               
            </div>
        </s:form>        
    </body>
</html>
